﻿
namespace ProbabilitySequnce
{
    public class OptionState 
    {

        public string Key { get; set; }

        /// <summary>
        /// 总量
        /// </summary>
        public int Total { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int Count { get; set; }

  
        /// <summary>
        /// 当前数量
        /// </summary>
        public int Current { get; set; }

        public decimal OriginRate { get; set; }

        public decimal UseRate {  get; set; }

        public static OptionState Create( Option option, int total)
        {
            return new OptionState
            {
                Total = total,
                Key = option.Key,
                Count = option.Count,
                OriginRate = option.Count *1.0M / total,
                UseRate = option.Count * 1.0M / total
            };
        }
    }
}
